package com.iwhalecloud.citybrain.flow.platform.manager.domain.model;

import java.util.Date;

import com.iwhalecloud.citybrain.flow.platform.manager.common.utils.RelativeDateFormatUtils;
import com.iwhalecloud.citybrain.flow.platform.manager.domain.enums.MsgTypeEnum;
import org.springframework.beans.BeanUtils;

/**
 * @author lilh
 * @date 2019-04-25 15:48
 */
public class FlowIssueNoticeListVo {

    /**
     * 主键
     */
    private String id;

    /**
     * 流程实例id
     */
    private String processInstanceId;

    /**
     * 通知标题
     */
    private String processName;


    /**
     * 通知类型
     */
    private String msgType;

    /**
     * 发送人名称
     */
    private String senderName;

    private String msgTypeDescr;

    /**
     * 未读：0， 已读：1
     */
    private Integer readStatus;


    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 相对时间描述
     */
    private String relativeTime;


    /**
     * 下发说明
     */
    private String description;

    public FlowIssueNoticeListVo(FlowIssueNoticeVo entity) {
        BeanUtils.copyProperties(entity, this);
        this.msgTypeDescr = MsgTypeEnum.getDescrByCode(this.msgType);
        this.relativeTime = RelativeDateFormatUtils.format(this.createTime);
    }

    public String getProcessName() {
        return processName;
    }

    public void setProcessName(String processName) {
        this.processName = processName;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProcessInstanceId() {
        return processInstanceId;
    }

    public void setProcessInstanceId(String processInstanceId) {
        this.processInstanceId = processInstanceId;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getMsgTypeDescr() {
        return msgTypeDescr;
    }

    public void setMsgTypeDescr(String msgTypeDescr) {
        this.msgTypeDescr = msgTypeDescr;
    }

    public Integer getReadStatus() {
        return readStatus;
    }

    public void setReadStatus(Integer readStatus) {
        this.readStatus = readStatus;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getRelativeTime() {
        return relativeTime;
    }

    public void setRelativeTime(String relativeTime) {
        this.relativeTime = relativeTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public String toString() {
        return "FlowIssueNoticeVo{" +
                "id='" + id + '\'' +
                ", processInstanceId='" + processInstanceId + '\'' +
                ", processName='" + processName + '\'' +
                ", msgType='" + msgType + '\'' +
                ", senderName='" + senderName + '\'' +
                ", msgTypeDescr='" + msgTypeDescr + '\'' +
                ", readStatus=" + readStatus +
                ", createTime=" + createTime +
                ", relativeTime='" + relativeTime + '\'' +
                ", description='" + description + '\'' +
                '}';
    }
}
